home *** CD-ROM | disk | FTP | other *** search
/ CU Amiga Super CD-ROM 24 / CU Amiga Magazine's Super CD-ROM 24 (1998)(EMAP Images)(GB)(Track 1 of 2)[!][issue 1998-07].iso / CUCD / Programming / SWI / source / html / pl.sty < prev    next >
Encoding:
Text File  |  1997-07-16  |  8.8 KB  |  298 lines

  1. %            SWI-Prolog document-style
  2.  
  3. %    Other styles
  4.  
  5. \input logo.sty
  6. \usepackage{a4wide}
  7. \usepackage{fancyheadings}
  8. \usepackage{fancychap}
  9. \usepackage{makeidx}
  10. \usepackage{longtable}
  11. \usepackage{ifthen}
  12. \usepackage{dcolumn}
  13. \usepackage{url}
  14. \setlongtables
  15.  
  16. \catcode`\^^A=8% downarrow are for subscripts
  17. \catcode`\_=\active
  18. \def_{\ifmmode\else\_\fi}
  19. \def\vobeyspaces{\@vobeyspaces}
  20.  
  21. \newcommand{\onlinebreak}{}
  22.  
  23. %    References
  24.  
  25. \newcommand{\secref}[1]{section~\ref{sec:#1}}
  26. \newcommand{\appref}[1]{appendix~\ref{sec:#1}}
  27. \newcommand{\chapref}[1]{chapter~\ref{sec:#1}}
  28. \newcommand{\figref}[1]{figure~\ref{fig:#1}}
  29. \newcommand{\tabref}[1]{table~\ref{tab:#1}}
  30.  
  31. \newcommand{\Secref}[1]{Section~\ref{sec:#1}}
  32. \newcommand{\Appref}[1]{Appendix~\ref{sec:#1}}
  33. \newcommand{\Chapref}[1]{Chapter~\ref{sec:#1}}
  34. \newcommand{\Figref}[1]{Figure~\ref{fig:#1}}
  35. \newcommand{\Tabref}[1]{Table~\ref{tab:#1}}
  36.  
  37. \newcommand{\tm}{$^{tm}$}
  38.  
  39. \newcommand{\predref}[2]{%        % functor/arity
  40.     \mbox{\tt #1/#2}}
  41. \newcommand{\functor}[2]{%        % functor/arity (no predicate)
  42.     \mbox{\tt #1/#2}}
  43. \newcommand{\manref}[2]{%        % page(n)
  44.     \mbox{{\tt #1(}{\rm #2}{\tt )}}}
  45. \newcommand{\funcref}[2]{%        % function(Args...)
  46.     \mbox{{\tt #1(}{\it #2}{\tt )}}}
  47.  
  48. %    Descriptions (definitions) of various things
  49.  
  50. \newcommand{\definition}[1]{%
  51.     \onlinebreak%
  52.     \item[\mbox{#1}]\hfill\mbox{}\linebreak}
  53. \newcommand{\emptydefinition}[1]{%
  54.     \makebox[-\leftmargin]{\mbox{}}\mbox{\bf #1}\\}
  55.  
  56. \makeatletter
  57. \def\cmdlineoptionitem{\@ifstar{\@gluedcmdoptitem}{\@cmdoptitem}}
  58. \def\@gluedcmdoptitem#1#2{\definition{#1\var{#2}}}
  59. \def\@cmdoptitem#1#2{\definition{#1 \var{#2}}}
  60. \makeatother
  61.  
  62. \newcommand{\traceoption}[3]{%
  63.     \definition{{\tt #1} (#2)}#3%
  64.     \ignorespaces}
  65. \newcommand{\pleaseoption}[3]{%
  66.     \definition{#1 {\it #2} {\rm(default: \it #3)}}%
  67.     \ignorespaces}
  68. \newcommand{\featureoption}[2]{%
  69.     \definition{#1 ({\it #2})}%
  70.     \ignorespaces}
  71. \newcommand{\escapeitem}[1]{%
  72.     \definition{\Sesc{\tt #1}}
  73.     \ignorespaces}
  74. \newcommand{\fmtchar}[1]{%
  75.     \item[\tt #1]%
  76.     \ignorespaces}
  77. \newcommand{\directive}[3]{%
  78.     \definition{:- #1({\it #3})}%
  79.     \index{#1/#2}\ignorespaces}
  80. \newcommand{\predicate}[3]{%
  81.     \ifthenelse{\equal{#2}{0}}{%
  82.         \definition{#1}}{%
  83.         \definition{#1({\it #3})}}%
  84.     \index{#1/#2}\ignorespaces}
  85. \newcommand{\infixop}[3]{%
  86.     \definition{{\it #2} #1 {\it #3}}%
  87.     \index{#1/2}\ignorespaces}
  88. \newcommand{\prefixop}[2]{%
  89.     \definition{#1 {\it #2}}%
  90.     \index{#1/1}\ignorespaces}
  91. \newcommand{\termitem}[2]{%
  92.     \ifthenelse{\equal{}{#2}}{%
  93.         \definition{#1}}{%
  94.         \definition{#1({\it #2})}}\ignorespaces}
  95. \def\term{}
  96. \renewcommand{\term}[2]{%
  97.     \ifthenelse{\equal{}{#2}}{%
  98.         #1}{%
  99.         #1({\it #1})}}
  100. \newcommand{\cfunction}[3]{%
  101.     \definition{{\tt #1} #2{\rm (}{\it #3}{\rm )}}%
  102.     \index{#2()}\ignorespaces}
  103. \newcommand{\cdecl}[2]{{\tt #1} {\em #2}}
  104. \newcommand{\cmacro}[3]{%
  105.     \definition{{\it #1} #2({\it #3})}%
  106.     \index{#2()}\ignorespaces}
  107. \newcommand{\cglobalvar}[1]{{\tt #1}}
  108.  
  109. \renewcommand{\arg}[1]{\ifmmode\mbox{\em #1}\else{\em #1}\fi}
  110. \newcommand{\bnfmeta}[1]{\ifmmode{\langle\mbox{\it #1}\rangle}\else$\langle\mbox{\it #1}\rangle$\fi}
  111. \newcommand{\bnfor}{\ifmmode\mid\else$\mid$\fi}
  112. \newcommand{\isa}{& ::= &}
  113. \newcommand{\ora}{& $\mid$ &}
  114.  
  115. \newcommand{\class}[1]{{\em #1}\index{#1 \string\idxtype{class}}}
  116. \newcommand{\classs}[1]{{\em #1s}\index{#1 \string\idxtype{class}}}
  117. \newcommand{\demo}[1]{{\sf #1}\index{#1 \string\idxtype{demo}}}
  118. \newcommand{\pllib}[1]{library({\tt #1})\index{#1 \string\idxtype{library}}}
  119. \newcommand{\clib}[1]{{\tt #1}\index{#1 \string\idxtype{library}}}
  120. \newcommand{\tool}[1]{{\em #1}\index{#1 \string\idxtype{tool}}}
  121. \newcommand{\constf}[1]{{\tt #1}}
  122. \newcommand{\const}[1]{{\tt #1}}
  123. \newcommand{\type}[1]{{\tt #1}}
  124. \newcommand{\idx}[1]{#1\index{#1}}
  125. \newcommand{\foreseen}[1]{\footnote{#1}}
  126. \newcommand{\email}[1]{\mbox{\tt #1}}
  127. %\newcommand{\url}[1]{\mbox{\tt #1}}
  128. \newcommand{\env}[1]{\mbox{\tt #1}}
  129. \newcommand{\exam}[1]{\mbox{\tt #1}}
  130. \newcommand{\file}[1]{\mbox{\tt #1}}
  131. \newcommand{\fileext}[1]{\mbox{\tt .#1}}
  132. \newcommand{\option}[1]{\mbox{\tt #1}}
  133. \newcommand{\cmdlineoption}[1]{\mbox{\tt #1}}
  134. \newcommand{\argoption}[2]{\mbox{\tt #1 \em #2}}
  135. \newcommand{\ctype}[1]{{\tt #1}}
  136. \newcommand{\op}[1]{{\tt #1}}
  137. \newcommand{\program}[1]{{\tt #1}}
  138. \newcommand{\manpage}[2]{{\bf #1}(#2)}
  139. \newcommand{\chr}[1]{{\tt #1}}
  140. \newcommand{\jargon}[1]{{\em #1}}
  141. \newcommand{\strong}[1]{{\bf #1}}
  142. \newcommand{\texcmd}[1]{{\Sesc}{\tt #1}}
  143. \newcommand{\texenv}[1]{{\tt #1}}
  144. \newcommand{\texmode}[1]{{\tt #1}}
  145. \newcommand{\HTML}[1]{{\bf #1}}
  146.  
  147. \newcommand\satom{\begingroup \urlstyle{tt}\Url}
  148. \newcommand\fmtseq{\begingroup \urlstyle{tt}\Url}
  149. %\newcommand\file{\begingroup \urlstyle{tt}\Url}
  150.  
  151. \urldef{\Sexe}\satom{#!}        % #!
  152. \urldef{\Scut}\satom{!}            % !
  153. \urldef{\Scomma}\satom{,}        % ,
  154. \urldef{\Sifthen}\satom{->}        % ->
  155. \urldef{\Ssoftcut}\satom{*->}         % *->
  156. \urldef{\Sdot}\satom{.}         % .
  157. \urldef{\Ssemicolon}\satom{;}         % ;
  158. \urldef{\Slt}\satom{<}             % <
  159. \urldef{\Seq}\satom{=}             % =
  160. \urldef{\Suniv}\satom{=..}         % =..
  161. \urldef{\Saeq}\satom{=:=}         % =:=
  162. \urldef{\Sle}\satom{=<}         % =<
  163. \urldef{\Sequal}\satom{==}         % ==
  164. \urldef{\Sstructeq}\satom{=@=}         % =@=
  165. \urldef{\Sstructneq}\satom{\=@=}     % \=@=
  166. \urldef{\Sane}\satom{=\=}         % =\=
  167. \urldef{\Sgt}\satom{>}             % >
  168. \urldef{\Sge}\satom{>=}         % >=
  169. \urldef{\Stlt}\satom{@<}         % @<
  170. \urldef{\Stle}\satom{@=<}         % @=<
  171. \urldef{\Stgt}\satom{@>}         % @>
  172. \urldef{\Stge}\satom{@>=}         % @>=
  173. \urldef{\Snot}\satom{\+}         % \+
  174. \urldef{\Sne}\satom{\=}         % \=
  175. \urldef{\Snequal}\satom{\==}         % \==
  176. \urldef{\Shat}\satom{^}         % ^
  177. \urldef{\Sbar}\satom{|}         % |
  178. \urldef{\Stimes}\satom{*}        % *
  179. \urldef{\Spow}\satom{**}        % **
  180. \urldef{\Splus}\satom{+}        % +
  181. \urldef{\Sminus}\satom{-}        % -
  182. \urldef{\Sdiv}\satom{/}            % /
  183. \urldef{\Sidiv}\satom{//}        % //
  184. \urldef{\Sand}\satom{/\}        % /\
  185. \urldef{\Slshift}\satom{<<}        % <<
  186. \urldef{\Srshift}\satom{>>}        % >>
  187. \urldef{\Sneg}\satom{\}            % \
  188. \urldef{\Sesc}\satom{\}            % \
  189. \urldef{\Sor}\satom{\/}            % \/
  190. \urldef{\Sdollar}\satom{$}        % $
  191. \urldef{\Squest}\satom{?}        % ?
  192. \urldef{\Smodule}\satom{:}        % :
  193. \urldef{\Sneck}\satom{:-}        % :-
  194. \urldef{\Sdirective}\satom{?-}        % ?-
  195. \urldef{\Sdcg}\satom{-->}        % -->
  196. \urldef{\Bc}\satom{\c}            % \c
  197. \urldef{\Bn}\satom{\n}            % \n
  198. \urldef{\Br}\satom{\r}            % \r
  199. \urldef{\Bl}\satom{\l}            % \l
  200. \urldef{\BB}\satom{\\}            % \\
  201. \urldef{\Stilde}\satom{~}        % ~
  202. \urldef{\Spercent}\satom{%}        % %
  203. \urldef{\Shash}\satom{#}        % #
  204.  
  205. \newcommand{\bug}[1]{\footnote{BUG: #1}}
  206.  
  207. \newcommand{\mod}[2]{#1 \mbox{\rm mod} #2}
  208. \newcommand{\rem}[2]{#1 \mbox{\rm rem} #2}
  209. \newcommand{\pow}[2]{{#1}^{#2}}
  210.  
  211. %    Index handling
  212.  
  213. \newcommand{\idxtype}[1]{{\small\em #1}}
  214.  
  215. %    Prolog predicate summary
  216.  
  217. \newenvironment{summarylist}[1]{\begin{longtable}[l]{#1}}{\end{longtable}}
  218. \newcommand{\predicatesummary}[3]{#1/#2 & #3 \\}
  219. \newcommand{\oppredsummary}[5]{#1/#2 & #5 \\}
  220. \newcommand{\functionsummary}[3]{#1/#2 & #3 \\}
  221. \newcommand{\opfuncsummary}[5]{#1/#2 & #5 \\}
  222. \newcommand{\opsummary}[4]{#3 & #1 & #2 & #4 \\}
  223. \newcommand{\hook}[1]{(hook)}
  224.  
  225.  
  226. %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
  227. %            CODE environment            %
  228. %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
  229.  
  230. %    just like verbatim, but indents like quote.
  231. %    allows also the use of leading tabs
  232.  
  233. \makeatletter
  234. {\catcode`\^^I=\active
  235.     \gdef^^I{\mbox{}\space\space\space\space\space\space\space\space}}
  236.  
  237. \begingroup \catcode `|=0 \catcode `[= 1
  238. \catcode`]=2 \catcode `\{=12 \catcode `\}=12
  239. \catcode`\\=12
  240. |gdef|@xcode#1\end{code}[#1|end[code]]
  241. |endgroup
  242.  
  243. \def\@code{\trivlist \item[]\if@minipage\else\vskip\parskip\fi
  244. \leftskip\@totalleftmargin\rightskip\z@
  245. \parindent\z@\parfillskip\@flushglue\parskip\z@
  246. \@tempswafalse \def\par{\if@tempswa\hbox{}\fi\@tempswatrue\@@par}
  247. \obeylines \catcode`\^^I=\active \tt \let\do\@makeother \dospecials}
  248.  
  249. \def\code{\quote \@code \frenchspacing\@vobeyspaces \@xcode}
  250. \def\@endcode{\endtrivlist\mbox{}\endquote}
  251. \let\endcode=\@endcode
  252.  
  253.  
  254. %    PostScript figures
  255. %    \postscriptfig[width=5in]{label}{Title}
  256.  
  257. \def\postscriptfig{\@ifnextchar[{\@scaledpostscriptfig}{\@postscriptfig}}
  258. \def\@scaledpostscriptfig[#1]#2#3{%
  259.     \begin{figure}%
  260.         \centerline{\psfig{figure=figs/#2.ps,#1}}
  261.         \caption{#3}
  262.         \label{fig:#2}
  263.     \end{figure}}
  264. \def\@postscriptfig#1#2{%
  265.     \begin{figure}%
  266.         \centerline{\psfig{figure=figs/#1.ps}}
  267.         \caption{#2}
  268.         \label{fig:#1}
  269.     \end{figure}}
  270. \makeatletter
  271.  
  272.  
  273. %    PAGESTYLE
  274. %
  275. %       Chapter                            date
  276. %       ---------------------------------------
  277. %
  278. %    bla, bla, bla, ...
  279. %    
  280. %       \bottomleft    - page -    \bottomright
  281.  
  282. \def\arabicday{\number\year-\number\month-\number\day}
  283.  
  284. \providecommand{\runningtitle}{SWI-Prolog \versionshort}
  285.  
  286. \pagestyle{fancyplain}
  287. \headheight 14pt
  288. \def\chaptermark{\mbox{}}
  289. \renewcommand{\chaptermark}[1]{\markboth{#1}{#1}} % remember chapter title
  290. \renewcommand{\sectionmark}[1]{\markright{\thesection\ #1}}
  291.  
  292. \lhead[\fancyplain{}{\bf\thepage}]{\fancyplain{}{\bf\rightmark}}
  293. \rhead[\fancyplain{}{\bf\leftmark}]{\fancyplain{}{\bf\thepage}}
  294. \footrulewidth 0.2pt
  295. \lfoot[\tiny \runningtitle]{}
  296. \rfoot[]{\tiny \runningtitle}
  297. \cfoot{}
  298.